#include <iostream>

class Camera{
public:
    //析构函数记得写为虚函数
    virtual ~Camera(){}

    virtual int get_frame() = 0;
};

class BaslerCamera: public Camera{
    int get_frame();
};

int BaslerCamera::get_frame(){
    std::cout << "basler get frame" << std::endl;
    return 1;
}

class FleaCamera: public Camera{
    int get_frame();
};

int FleaCamera::get_frame(){
    std::cout << "flea get frame" << std::endl;
    return 2;
}

int main(){
    Camera* camera;
    camera = new BaslerCamera();
    camera->get_frame();
    //记得删除
    delete camera;

    camera = new FleaCamera();
    camera->get_frame();
    delete camera;
}
